package ml.tewas.weaponassignment;

/**
 * The Class WeaponAssignmentQTableThreatStruct.
 */
public class WeaponAssignmentQTableThreatStruct {

	/** The q value. */
	private float qValue = 0f;

	/** The total queried. */
	private int totalQueried = 0;

	/** The total selected. */
	private int totalSelected = 0;

	/**
	 * Gets the q value.
	 * 
	 * @return the q value
	 */
	public float getQValue() {
		return qValue;
	}

	/**
	 * Sets the q value.
	 * 
	 * @param value
	 *            the new q value
	 */
	public void setQValue(float value) {
		qValue = value;
	}

	/**
	 * Gets the other agent selection probability.
	 * 
	 * @return the other agent selection probability
	 */
	public float getOtherAgentSelectionProbability() {
		if(totalSelected == 0)
			return 0;
		return ((float) totalSelected) / ((float) totalQueried);
	}

	/**
	 * Adds the total selected.
	 */
	public void addTotalSelected() {
		this.totalSelected++;
	}

	/**
	 * Adds the total queried.
	 */
	public void addTotalQueried() {
		this.totalQueried++;
	}

	public void setTotalQueried(int totalQueried) {
		this.totalQueried = totalQueried;
	}

	public void setTotalSelected(int totalSelected) {
		this.totalSelected = totalSelected;
	}

	public int getTotalQueried() {
		return totalQueried;
	}

	public int getTotalSelected() {
		return totalSelected;
	}
}
